#include "chat.h"

Chat::Chat() { }

Chat::Chat(int id,const QList<Friend*> &friends):id(id),friends(friends) { } 

Chat::~Chat() { } 

void Chat::setId(int id){
	this->id=id;
}

int Chat::getId(){
	return id;
}

QList<Friend*> Chat::getFriends(){
	return friends;
}

void Chat::addFriend(Friend *friend_){
	friends.push_back(friend_);
}

void Chat::removeFriend(Friend* friend_) {
	friends.removeAll(friend_);
}

bool Chat::containsFriend(Friend* friend_) {
	foreach(Friend* f, friends) {
		if(friend_->getId() == f->getId())
			return true;
	}
	return false;
}
